Filesystem in Userspace (FUSE) is a mechanism that permits filesystems to be added as user-space programs, without needing to write kernel code. Support for a number of useful filesystems are available as FUSE programs(?). OI has bundled a FUSE driver and some fuse based filesystems, but most of the other illumos variants don't include this. I've put together a patch for Joyent's SmartOS that includes the necessary components for using FUSE filesytems both in the global zone and your own native zones. The necessary components for using FUSE filesystems are the FUSE kernel driver, libfuse and its assorted header files, and a set of programs for mounting and unmounting FUSE filesystems. You'll need a platform image built with these components, which is available here: https://bill.welliver.org/dist/smartos/builds/fuse Next, you'll need a FUSE filesystem program. I'll demonstrate using sshfs. Create a new native zone (in this case, I'm using the base64-trunk image) In order to use FUSE in our new zone, we need to share the fuse device with the zone, and grant the zone permission to mount fuse filesystems.
globalzone# zonecfg -f MYZONEUUID << EOF add device set match=/dev/fuse end exit EOF globalzone# vmadm update MYZONEUUID fs_allowed="fuse" globalzone# vmadm reboot MYZONEUUID
myzone# pkgin -y install build-essential glib2 myzone# git clone https://github.com/alhazred/illumos-sshfs myzone# cd illumos-sshfs/sshfs-fuse/ myzone# vi sshfs.c # comment out the line with "g_thread_init()" myzone# SSHFS_CFLAGS="-I/usr/include/fuse -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include" SSHFS_LIBS="-lfuse -lglib-2.0 -lxnet" ./configure myzone# make myzone# mkdir /tmp/sshfs-test myzone# ./sshfs user@host:/path /tmp/sshfs-test myzone# test out your filesystem myzone# umount /tmp/sshfs-test
mylxzone# ln -s /native/usr/lib/fs /usr/lib/fs mylxzone# vi /tmp/pfexec #!/bin/bash exec $* mylxzone# chmod 755 /tmp/pfexec
sshfs /opt/local/lib/libglib-2.0* /opt/local/lib/libiconv-2* /opt/local/lib/libpcre-2* /opt/local/lib/libintl*
mylxzone# PATH=$PATH:/tmp:/native/usr/bin ./sshfs user@host:/path /tmp/sshfs-test